import * as types from './ActionTypes.js';
import {createAction} from 'redux-actions';
import {fetchRequest, JsonFetch} from '../util/fetch';


//查询我的消息
export const SelSystemNew = createAction(types.SEL_MSGALL_MOB, (data) => {
    return fetchRequest('xzMsg/selMsgAllMob.go', 'POST', data);
});

//20171216-王继顺
//企业首页-查询消息
export const SelComMsgAll = createAction(types.SEL_COM_MSGALL_MOB, (data) => {
    return fetchRequest('xzMsg/selComMsgAllMob.go', 'POST', data);
});

//删除我的消息
export const DeleteByIdMobAction = createAction(types.DELETEBYIDMOB, (data) => {
    return fetchRequest('xzMsg/deleteByIdMob.go', 'POST', data);
});

//消息设为已读
export const IsReadByIdAction = createAction(types.ISREAD_BYID, (data) => {
    return fetchRequest('xzMsg/isReadByIdMob.go', 'POST', data);
});

export const SelBrowseHistory = createAction(types.SEL_BROWSE_HISTORY, (data) => {
    return fetchRequest('Postion/selPostionBrowse.go', 'POST', data);
});

export const SelCollectPosition = createAction(types.SEL_COLLECT_POSITION, (data) => {
    return fetchRequest('yyy', 'GET');
});

//个人简历
export const EditResumeAction = createAction(types.EDIT_RESUME, (data) => {
    return fetchRequest('Resume/goEditResumeMob.go', 'POST', data);
});

//编辑个人简历
export const UpdateResumeAction = createAction(types.UPDATE_RESUME, (data) => {
    return JsonFetch('Resume/updateResumeMob.go', 'POST', data);
});

//我的信息
export const MemberInfoAction = createAction(types.SEL_MEMBERINFO_MOB, (data) => {
    return fetchRequest('Member/selMemberInfoMob.go?memberId=' + data, 'GET');
});

//修改我的消息
export const updateMemberInfoAction = createAction(types.UPDATE_MEMBERINFO, (data) => {
    return fetchRequest('Member/updateMemberInfoMob.go', 'POST', data);
});

//修改工作经验
export const updateJobExpAction = createAction(types.UPDATE_JOBEXP, (data) => {
    return JsonFetch('Resume/updateJobExp.go', 'POST', data);
});

//添加工作经验
export const InsertJobExpAction = createAction(types.INSERT_JOBEXP, (data) => {
    return JsonFetch('Resume/insertJobExp.go', 'POST', data);
});

//添加教育经历
export const InsertEduAction = createAction(types.INSERT_EDUCATION, (data) => {
    return fetchRequest('Resume/insertEducation.go', 'POST', data);
});

//修改教育经历
export const UpdateEduAction = createAction(types.UPDATE_EDUCATION, (data) => {
    return fetchRequest('Resume/updateEducation.go', 'POST', data);
});

//添加项目经验
export const InsertProAction = createAction(types.INSERT_PROJECTEXP, (data) => {
    return fetchRequest('Resume/insertProjectExp.go', 'POST', data);
});

//修改项目经验
export const UpdateEducationAction = createAction(types.UPDATE_PROJECTEXP, (data) => {
    return fetchRequest('Resume/updateProjectExp.go', 'POST', data);
});

//查询行业
export const SelFieldTypeAction = createAction(types.SELFIELD_BYTYPE, (data) => {
    return fetchRequest('Field/selByType.go', 'POST', data);
});

//修改密码
export const UpdatePasswordAction = createAction(types.UPDATE_PASSWORD, (data) => {
    return fetchRequest('XzLogin/updatePasswordMob.go', 'POST', data);
});

//发送邮箱验证码
export const RegisterSendEAction = createAction(types.REGISTER_SENDE, (data) => {
    return fetchRequest('XzRegister/registerSendE.go', 'POST', data);
});

//验证邮箱
export const RegisterSendE_YZAction = createAction(types.REGISTER_SENDE_YZ, (data) => {
    return fetchRequest('XzRegister/registerSendE_YZ.go', 'POST', data);
});

//查询xzlongin
export const SelxzLonginAction = createAction(types.SEL_XZLOGIN, (data) => {
    return fetchRequest('XzRegister/sel_XzLogin.go', 'POST', data);
});

//修改手机
export const UpdataPAction = createAction(types.UPDATE_PHONE, (data) => {
    return fetchRequest('XzLogin/updataP.go', 'POST', data);
});

//意见反馈
export const SendIdeaAction = createAction(types.SEND_IDEA, (data) => {
    return fetchRequest('XzRegister/sendIdea.go', 'POST', data);
}); 